﻿using System;

namespace ZeBobo5.LibraryHelper.Orm
{
    public class OrmDataElementSaveErrorEventArgs<T> : EventArgs
        where T : IOrmDataElementBase
    {
        private readonly T _data;
        private readonly Exception _innerException;
        private readonly OrmDataElementOperation _operation;

        public OrmDataElementSaveErrorEventArgs(T data, OrmDataElementOperation operation, Exception ex)
        {
            _data = data;
            _innerException = ex;
            _operation = operation;
        }

        public T Data
        {
            get { return _data; }
        }

        public Exception InnerException
        {
            get { return _innerException; }
        }

        public OrmDataElementOperation Operation
        {
            get { return _operation; }
        }
    }
}